# -*- coding:utf-8 -*-
"""
@file: predict_handler.py
@time: 2019/12/16 18:51
@author: ljt
descript:
"""
from abc import ABC
from ScoreCard.handler.base_request_handler import BaseRequestHandler
from ScoreCard.service.qy_score_svc import ScoredCardSvc


class SingleOrgScoreHandler(BaseRequestHandler, ABC):
    """ 招投标实体 预测"""

    def _get_request_arguments(self, *args, **kwargs):
        company = self.get_argument("company", strip=True)
        params = {"company": company}
        return params

    def _request_service(self, request_id, **kwargs):
        rule_svc = ScoredCardSvc()
        res_01 = rule_svc.get_qy_score(
            **kwargs)
        if isinstance(res_01,str):
            return res_01
        result_index, res_key_words, html_key, gg_name, href, jytype, ggtype, diqu, quyu_zh, page = res_01
        res = {
            "original": {
            },
        }
        return res

